package com.cloud.code.真题;

import java.util.Scanner;

/**
 * 输入字符串s，输出s中包含所有整数的最小和
 */
public class Demo10 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNext()) {


            String[] split = scanner.nextLine().replace("+", "").split("[a-zA-Z]");
            int sum = 0;
            for (int i = 0; i < split.length; i++) {
                String tem = split[i];
                if (tem.contains("-")) {
                    String[] split1 = tem.split("-");
                    for (int j = 0; j < split1[0].length(); j++) {
                        sum = sum + Integer.parseInt(split1[0].substring(j, j + 1));
                    }
                    sum = sum - Integer.parseInt(split1[1]);
                } else {
                    for (int j = 0; j < tem.length(); j++) {
                        sum = sum + Integer.parseInt(tem.substring(j, j + 1));
                    }
                }
            }

            System.out.println(sum);


        }
    }
}
